<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>拍照并将照片绘制成canvas</title>
</head>
<body>
  <div class="video-box">
    <!-- 拍照区域 -->
    <video id="video"></video>
    <!-- 拍照后绘制区域 -->
    <canvas id="camera-canvas" ></canvas>
    <!-- 拍照按钮 -->
    <div class="camera-icon" id="camera-icon" style="display: none;"></div>
  </div>
  <script src="./index.js"></script>
  <script>
    const canvas = document.querySelector('#camera-canvas') // canvas dom
    // 视频初始化配置
    const videoConfig = this.videoConfig('video-box')
    this.getMedia(videoConfig)
    /**
     * readme:
     * 未点击拍照按钮时，就展示前置摄像头拍摄到的东西，点击拍照时，将拍摄到的照片绘制到canvas上
     **/
  </script>
</body>
</html>